﻿using System;
using System.Data;
using Besture.Common;
using Besture.Dal;
using Besture.Model;

namespace Besture.Bll
{
    public partial class TrafficDac : BaseFacade
    {
        /// <summary>
        /// 根据酒店ID获取交通信息
        /// </summary>
        /// <param name="hotelsId"></param>
        /// <returns></returns>
        public DataTable GetDataTableByHotelsId(int hotelsId)
        {
            try
            {
                base.CreateConnection();
                TrafficDal excuteDal = new TrafficDal();
                return excuteDal.GetDataTableByHotelsId(hotelsId);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                CloseConnection();
            }
        }

        /// <summary>
        /// 根据酒店ID删除交通信息
        /// </summary>
        /// <param name="hotelsId"></param>
        /// <returns></returns>
        public int DeleteByHotelsId(int hotelsId)
        {
            try
            {
                base.CreateConnection();
                TrafficDal excuteDal = new TrafficDal();
                return excuteDal.DeleteByHotelsId(hotelsId);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                CloseConnection();
            }
        }
    }
}
